<html>
    <head>
        <title>Leaflet.Storage Tests</title>
        <meta charset="utf-8">
        <script src="../reqs/leaflet/leaflet-src.js"></script>
        <script src="../reqs/editable/Path.Drag.js"></script>
        <script src="../reqs/editable/Leaflet.Editable.js"></script>
        <script src="../reqs/hash/leaflet-hash.js"></script>
        <script src="../reqs/i18n/Leaflet.i18n.js"></script>
        <script src="../reqs/editinosm/Leaflet.EditInOSM.js"></script>
        <script src="../reqs/minimap/Control.MiniMap.js"></script>
        <script src="../reqs/csv2geojson/csv2geojson.js"></script>
        <script src="../reqs/togeojson/togeojson.js"></script>
        <script src="../reqs/osmtogeojson/osmtogeojson.js"></script>
        <script src="../reqs/contextmenu/leaflet.contextmenu-src.js"></script>
        <script src="../reqs/loading/Control.Loading.js"></script>
        <script src="../reqs/markercluster/leaflet.markercluster-src.js"></script>
        <script src="../reqs/photon/leaflet.photon.js"></script>
        <script src="../reqs/heat/leaflet-heat.js"></script>
        <script src="../reqs/fullscreen/Leaflet.fullscreen.js"></script>
        <script src="../reqs/toolbar/leaflet.toolbar-src.js"></script>
        <script src="../reqs/formbuilder/Leaflet.FormBuilder.js"></script>
        <script src="../reqs/measurable/Leaflet.Measurable.js"></script>
        <script src="../src/js/leaflet.storage.core.js"></script>
        <script src="../src/js/leaflet.storage.popup.js"></script>
        <script src="../src/js/leaflet.storage.xhr.js"></script>
        <script src="../src/js/leaflet.storage.forms.js"></script>
        <script src="../src/js/leaflet.storage.icon.js"></script>
        <script src="../src/js/leaflet.storage.features.js"></script>
        <script src="../src/js/leaflet.storage.layer.js"></script>
        <script src="../src/js/leaflet.storage.controls.js"></script>
        <script src="../src/js/leaflet.storage.slideshow.js"></script>
        <script src="../src/js/leaflet.storage.tableeditor.js"></script>
        <script src="../src/js/leaflet.storage.js"></script>
        <script src="../contrib/js/storage.ui.default.js"></script>
        <link rel="stylesheet" href="../reqs/leaflet/leaflet.css" />
        <link rel="stylesheet" href="../reqs/minimap/Control.MiniMap.css" />
        <link rel="stylesheet" href="../reqs/editinosm/Leaflet.EditInOSM.css" />
        <link rel="stylesheet" href="../reqs/markercluster/MarkerCluster.css" />
        <link rel="stylesheet" href="../reqs/markercluster/MarkerCluster.Default.css" />
        <link rel="stylesheet" href="../reqs/contextmenu/leaflet.contextmenu.css" />
        <link rel="stylesheet" href="../reqs/toolbar/leaflet.toolbar.css" />
        <link rel="stylesheet" href="../reqs/measurable/Leaflet.Measurable.css" />
        <link rel="stylesheet" href="../src/css/storage.css" />
        <link rel="stylesheet" href="../contrib/css/storage.ui.default.css" />

        <script src="../node_modules/sinon/pkg/sinon.js"></script>
        <script src="../node_modules/mocha/mocha.js"></script>
        <script src="../node_modules/chai/chai.js"></script>
        <script src="../node_modules/happen/happen.js"></script>
        <link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
        <script type="text/javascript">
            mocha.setup({
                ui: 'bdd',
                bail: (window.location.search.indexOf('failfast') !== -1),
                ignoreLeaks: true
            });
            chai.config.includeStack = true;
            var assert = chai.assert;
            var expect = chai.expect;
        </script>
        <script src="./_pre.js"></script>
        <script src="./Map.js"></script>
        <script src="./DataLayer.js"></script>
        <script src="./TableEditor.js"></script>
        <script src="./Feature.js"></script>
        <script src="./Polyline.js"></script>
        <script src="./Polygon.js"></script>
        <script src="./Util.js"></script>
        <script src="./Controls.js"></script>
        <style type="text/css">
        #mocha {
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 10000;
            background-color: white;
            box-shadow: 0px 0px 8px 0px black;
            overflow-y: auto;
            display: none;
        }
        #mocha-stats {
            position: absolute;
        }
        </style>
    </head>
    <body>
        <div id="mocha"></div>
        <div id="map"></div>
        <script>
            var runner = (window.mochaPhantomJS || window.mocha).run(function (failures) {
                if (window.location.search.indexOf('debug') === -1) qs('#mocha').style.display = 'block';
                console.log(failures);
            });
            if (window.location.search.indexOf('debug') !== -1) {
                runner.on('fail', function(test, err) {
                    console.log(test.title, test.err);
                    console.log(test.err.expected, test.err.actual);
                    console.log(test.err.stack);
                });
                sinon.log = function (message) {
                    console.log(message);
                };
            }
        </script>
    </body>
</html>
